﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection.Emit;
using System.Reflection;
using System.ServiceModel;

namespace AutoWrapper
{
    public static class ServiceAttributeBuilders
    {
        public static CustomAttributeBuilder ServiceContractAttributeBuilder()
        {
            ConstructorInfo serviceContractAttributeConstructorInfo = typeof(ServiceContractAttribute).GetConstructor(new Type[] { });
            //动态创建ClassCreatorAttribute           
            CustomAttributeBuilder myCABuilder = new CustomAttributeBuilder(
                serviceContractAttributeConstructorInfo, new object[] { });
            return myCABuilder;
        }
        public static CustomAttributeBuilder OperationContractAttributeBuilder()
        {
            ConstructorInfo operationContractAttributeInfo = typeof(OperationContractAttribute).GetConstructor(new Type[] { });
            CustomAttributeBuilder constructorAttributeInfo = new CustomAttributeBuilder(
           operationContractAttributeInfo, new object[] { });
            return constructorAttributeInfo;
        }
    }
}
